package com.li.singleton;

/**
 * 饿汉模式
 */
public class SingletonByHungryMan {
    /**
     * 类加载时候就创建单例，浪费内存
     * 但是没有用到锁，效率很高
     */
    private static SingletonByHungryMan instance = new SingletonByHungryMan();

    private SingletonByHungryMan() {
    }

    public static SingletonByHungryMan getInstance() {
        return instance;
    }
}
